import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import axios from 'axios' ;

import qs from 'qs'
import Vuex from 'vuex'

Vue.use(Vuex) ;
Vue.config.productionTip = false

// 将qs挂载到vue实例上，使用时就可以 this.$qs 这样使用了
Vue.prototype.$qs = qs


// 添加请求拦截器，在请求头中加token
axios.interceptors.request.use(
    config => {
      if (localStorage.getItem('Token')) {
        config.headers.Token = localStorage.getItem('Token');
      }

      return config;
    },
    error => {
      return Promise.reject(error);
    });


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
